import React from "react";
import "./GTitle.scss";
import { Breadcrumb } from 'antd';
import { useLocation } from 'react-router-dom';
interface Props {
  title: string;
  children?: any;
}

export default function GTitle({ title = "标题", children }: Props) {
  var routes = useLocation()
  console.log(`routeMatch`, routes.state.title)
  console.log('GTitle render')
  return (
    <div className="GTitle">
      <div className="left">
        {/* <Breadcrumb>
          <Breadcrumb.Item>Home</Breadcrumb.Item>
          <Breadcrumb.Item>
            <a href="">{routes.state.title}</a>
          </Breadcrumb.Item>
          <Breadcrumb.Item>
            <a href="">Application List</a>
          </Breadcrumb.Item>
          <Breadcrumb.Item>An Application</Breadcrumb.Item>
        </Breadcrumb> */}
        <div className="title">{title}</div>
      </div>
      <div className="right">{children}</div>
    </div>
  );
}
